import request from '@/utils/request.js'
// //提供调用优惠券数据接口的函数
export const CouponTakeService=(coupons)=>{
    // const coupon = new URLSearchParams();
    // for (let key in coupons) {
    //     coupon.append(key, coupons[key]);
    // }
     return request.post('/couponItems/insert',coupons);
 }

// export const GetService=()=>{
//     return request.post('/coupon');
// }
export const PostService=()=>{
    return request.post('/coupon');
}

export const getService=()=>{
    return request.get('/backend/coupon');
}

export const delCouponService=(id)=>{

    return request.delete('/backend/coupon?id='+id);
}
export const upCouponInfoService=(CouponInfo)=>{
    const coupon = new URLSearchParams();
    for (let key in CouponInfo) {
        coupon.append(key, CouponInfo[key]);
    }
    return request.post('/backend/coupon/update',coupon);
}

export const couponInsertService=(CouponInfo)=>{
    const coupon = new URLSearchParams();
    for (let key in CouponInfo) {
        coupon.append(key, CouponInfo[key]);
    }

    return request.post('/backend/coupon/insert',coupon);
}

